defaultApplyAsset

abstract suspend fun defaultApplyAsset(asset: Asset): DesignBlock?

This is the default implementation of applying asset to the active scene. This means a design block is instantiated and configured according to the Asset.meta properties.

Cancelling the coroutine stops the download that the call waits for, and no block is created.

Return

the newly created block or null if no new block is created.

Parameters

asset

the asset to be applied to the active scene. Normally it's a single result of a findAssets query.


abstract suspend fun defaultApplyAsset(asset: Asset, placement: AssetPlacement): DesignBlock?

This is the default implementation of applying asset to the active scene, placing the new block as requested. An asset that holds a transform preset or a scene replaces the page or the scene, so it uses neither the parent nor the center. An archived block collection keeps its own positions and uses only the parent.

Cancelling the coroutine stops the download that the call waits for, and no block is created.

Return

the newly created block or null if no new block is created.

Parameters

asset

the asset to be applied to the active scene. Normally it's a single result of a findAssets query.

placement

the parent block and the center position for the new block.


abstract suspend fun defaultApplyAsset(asset: Asset, block: DesignBlock)

This is the default implementation of applying asset object to an existing block. This means it replaces the block content with asset content, if compatible.

An aspect ratio or fixed size preset reads the block's layout, so the call performs an internal update to lay out pending changes. With the setting features/implicitUpdatesEnabled off, the preset can read the layout of the last update instead of pending changes. A block with no layout on a page that single page mode hides returns an error.

Parameters

asset

the asset that will be applied to the existing block. Normally it's a single result of a findAssets query.

block

the block that will be modified by the asset.